```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JAX-WS 技术详解 - 技术小馆</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        .serif {
            font-family: 'Noto Serif SC', serif;
        }
        .bg-gradient-primary {
            background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
        }
        .bg-gradient-secondary {
            background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
        }
        .code-block {
            background-color: #2d2d2d;
            color: #f8f8f2;
            border-radius: 8px;
            overflow: hidden;
        }
        .code-header {
            background-color: #1e1e1e;
            padding: 8px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .copy-btn {
            background-color: transparent;
            border: none;
            color: #9e9e9e;
            cursor: pointer;
            transition: all 0.3s;
        }
        .copy-btn:hover {
            color: #ffffff;
        }
        .section-divider {
            height: 2px;
            background: linear-gradient(90deg, transparent 0%, #3a7bd5 50%, transparent 100%);
            margin: 3rem 0;
        }
        .feature-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .tooltip {
            position: relative;
            display: inline-block;
        }
        .tooltip .tooltip-text {
            visibility: hidden;
            width: 200px;
            background-color: #555;
            color: #fff;
            text-align: center;
            border-radius: 6px;
            padding: 5px;
            position: absolute;
            z-index: 1;
            bottom: 125%;
            left: 50%;
            margin-left: -100px;
            opacity: 0;
            transition: opacity 0.3s;
        }
        .tooltip:hover .tooltip-text {
            visibility: visible;
            opacity: 1;
        }
        .nav-item {
            position: relative;
        }
        .nav-item:after {
            content: "";
            position: absolute;
            width: 0;
            height: 2px;
            bottom: 0;
            left: 0;
            background-color: #3a7bd5;
            transition: width 0.3s;
        }
        .nav-item:hover:after {
            width: 100%;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <header class="bg-gradient-primary text-white py-20">
        <div class="container mx-auto px-6 text-center">
            <div class="max-w-4xl mx-auto">
                <h1 class="text-5xl font-bold mb-6 serif">JAX-WS 技术详解</h1>
                <p class="text-xl mb-8 opacity-90">Java API for XML Web Services - 构建企业级SOAP服务的完整指南</p>
                <div class="bg-white bg-opacity-20 rounded-lg p-4 inline-block">
                    <i class="fas fa-info-circle mr-2"></i>
                    <span>适用于金融、医疗等高安全性需求场景</span>
                </div>
            </div>
        </div>
    </header>

    <!-- Navigation -->
    <nav class="sticky top-0 bg-white shadow-sm z-10">
        <div class="container mx-auto px-6 py-4">
            <div class="flex justify-center space-x-8">
                <a href="#overview" class="nav-item px-3 py-2 text-gray-700 hover:text-blue-600">技术概述</a>
                <a href="#setup" class="nav-item px-3 py-2 text-gray-700 hover:text-blue-600">环境搭建</a>
                <a href="#development" class="nav-item px-3 py-2 text-gray-700 hover:text-blue-600">服务开发</a>
                <a href="#client" class="nav-item px-3 py-2 text-gray-700 hover:text-blue-600">客户端调用</a>
                <a href="#optimization" class="nav-item px-3 py-2 text-gray-700 hover:text-blue-600">企业级优化</a>
                <a href="#case" class="nav-item px-3 py-2 text-gray-700 hover:text-blue-600">实战案例</a>
            </div>
        </div>
    </nav>

    <!-- Main Content -->
    <main class="container mx-auto px-6 py-12 max-w-6xl">
        <!-- Overview Section -->
        <section id="overview" class="mb-20">
            <h2 class="text-3xl font-bold mb-6 serif text-gray-800">一、JAX-WS 技术概述</h2>
            <p class="mb-6 text-lg text-gray-700 leading-relaxed">
                JAX-WS（Java API for XML Web Services）是 Java EE 标准中用于构建 SOAP 协议 Web 服务的核心框架，其核心优势在于通过注解简化开发流程，自动生成 WSDL 文件实现服务契约管理，并支持与多种企业级技术栈（如 Spring、Java EE）的无缝集成。
            </p>
            <p class="mb-8 text-lg text-gray-700 leading-relaxed">
                相较于 RESTful 服务，SOAP WebService 在金融、医疗等强一致性场景中仍具有不可替代性：
            </p>
            
            <div class="grid md:grid-cols-3 gap-8 mb-12">
                <div class="feature-card bg-white p-6 rounded-lg shadow-md transition-all duration-300">
                    <div class="text-blue-500 mb-4">
                        <i class="fas fa-file-contract text-3xl"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">协议标准化</h3>
                    <p class="text-gray-600">基于 SOAP 协议实现跨平台通信，支持消息签名、加密等安全机制</p>
                </div>
                <div class="feature-card bg-white p-6 rounded-lg shadow-md transition-all duration-300">
                    <div class="text-green-500 mb-4">
                        <i class="fas fa-handshake text-3xl"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">契约优先设计</h3>
                    <p class="text-gray-600">通过 WSDL 明确服务接口，确保服务消费者与提供者之间的契约一致性</p>
                </div>
                <div class="feature-card bg-white p-6 rounded-lg shadow-md transition-all duration-300">
                    <div class="text-purple-500 mb-4">
                        <i class="fas fa-building text-3xl"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">企业级特性</h3>
                    <p class="text-gray-600">支持事务管理、异步调用、消息路由等复杂业务需求</p>
                </div>
            </div>

            <div class="bg-blue-50 p-6 rounded-lg border-l-4 border-blue-500 mb-8">
                <div class="flex">
                    <div class="flex-shrink-0">
                        <i class="fas fa-lightbulb text-blue-500 text-2xl mt-1"></i>
                    </div>
                    <div class="ml-3">
                        <h3 class="text-lg font-medium text-blue-800">技术选型建议</h3>
                        <div class="mt-2 text-blue-700">
                            <p>在以下场景优先考虑 JAX-WS：</p>
                            <ul class="list-disc pl-5 mt-2 space-y-1">
                                <li>需要严格契约定义的企业系统集成</li>
                                <li>对安全性和事务有严格要求的关键业务</li>
                                <li>已有大量基于SOAP协议的遗留系统</li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Architecture Diagram -->
            <div class="mt-12">
                <h3 class="text-2xl font-semibold mb-6 serif text-gray-800">架构示意图</h3>
                <div class="mermaid">
                    graph LR
                    A[客户端] -->|SOAP请求| B(JAX-WS服务端)
                    B --> C[业务逻辑处理]
                    C --> D[数据库]
                    B -->|生成| E[WSDL]
                    A -->|引用| E
                    B -->|支持| F[WS-Security]
                    B -->|支持| G[事务管理]
                    B -->|支持| H[异步处理]
                </div>
            </div>
        </section>

        <div class="section-divider"></div>

        <!-- Environment Setup Section -->
        <section id="setup" class="mb-20">
            <h2 class="text-3xl font-bold mb-6 serif text-gray-800">二、环境搭建与项目初始化</h2>
            
            <div class="grid md:grid-cols-2 gap-8 mb-12">
                <div>
                    <h3 class="text-2xl font-semibold mb-4">1. 开发环境配置</h3>
                    <ul class="space-y-3 text-gray-700">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>JDK 版本：</strong>推荐使用 JDK 11+（需兼容 JAX-WS 2.3.3 版本）</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>IDE 配置：</strong>在 IDEA 中安装 "Java EE: Web Services" 插件，配置 Tomcat 10+ 作为应用服务器</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
                            <span><strong>依赖管理：</strong>通过 Maven 引入核心依赖</span>
                        </li>
                    </ul>
                </div>
                <div>
                    <h3 class="text-2xl font-semibold mb-4">2. 项目结构设计</h3>
                    <p class="text-gray-700 mb-4">采用分层架构设计：</p>
                    <div class="code-block rounded-lg">
                        <div class="code-header">
                            <span class="text-gray-400 text-sm">项目结构</span>
                            <button class="copy-btn">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <pre class="p-4 overflow-x-auto"><code>src/main/java
├── service
│   ├── HelloService.java       # 服务接口
│   └── HelloServiceImpl.java  # 服务实现
├── config
│   └── WebServiceConfig.java   # Spring 配置类
└── webapp/WEB-INF
    └── web.xml                # Web 服务配置文件</code></pre>
                    </div>
                </div>
            </div>

            <div class="bg-white p-6 rounded-lg shadow-md mb-8">
                <h3 class="text-xl font-semibold mb-4">Maven 依赖配置</h3>
                <div class="code-block rounded-lg mb-4">
                    <div class="code-header">
                        <span class="text-gray-400 text-sm">pom.xml</span>
                        <button class="copy-btn">
                            <i class="far fa-copy"></i>
                        </button>
                    </div>
                    <pre class="p-4 overflow-x-auto"><code>&lt;dependency&gt;
    &lt;groupId&gt;javax.xml.ws&lt;/groupId&gt;
    &lt;artifactId&gt;jaxws-api&lt;/artifactId&gt;
    &lt;version&gt;2.3.3&lt;/version&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
    &lt;groupId&gt;com.sun.xml.ws&lt;/groupId&gt;
    &lt;artifactId&gt;jaxws-rt&lt;/artifactId&gt;
    &lt;version&gt;2.3.3&lt;/version&gt;
&lt;/dependency&gt;</code></pre>
                </div>
                <div class="flex items-start text-blue-700">
                    <i class="fas fa-info-circle mt-1 mr-2"></i>
                    <span>注意：根据实际项目需求可能需要添加Spring、日志等其他依赖</span>
                </div>
            </div>
        </section>

        <div class="section-divider"></div>

        <!-- Service Development Section -->
        <section id="development" class="mb-20">
            <h2 class="text-3xl font-bold mb-6 serif text-gray-800">三、服务创建与发布</h2>
            
            <div class="space-y-12">
                <!-- Service Definition -->
                <div>
                    <h3 class="text-2xl font-semibold mb-4">1. 定义服务接口</h3>
                    <p class="text-gray-700 mb-4">使用 <code class="bg-gray-100 px-2 py-1 rounded">@WebService</code> 注解定义服务契约：</p>
                    <div class="code-block rounded-lg mb-4">
                        <div class="code-header">
                            <span class="text-gray-400 text-sm">HelloService.java</span>
                            <button class="copy-btn">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <pre class="p-4 overflow-x-auto"><code>@WebService(targetNamespace = "http://service.ts.com")
public interface HelloService {
    @WebMethod
    String sayHello(@WebParam(name = "username") String name);
}</code></pre>
                    </div>
                    <div class="bg-yellow-50 p-4 rounded-lg border-l-4 border-yellow-400">
                        <div class="flex">
                            <div class="flex-shrink-0">
                                <i class="fas fa-exclamation-circle text-yellow-500 mt-1"></i>
                            </div>
                            <div class="ml-3">
                                <h4 class="text-sm font-medium text-yellow-800">技术要点</h4>
                                <div class="mt-1 text-sm text-yellow-700">
                                    <p><code>targetNamespace</code> 用于生成唯一的命名空间，避免服务冲突</p>
                                    <p><code>@WebParam</code> 可自定义参数名称，提升可读性</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Service Implementation -->
                <div>
                    <h3 class="text-2xl font-semibold mb-4">2. 实现服务逻辑</h3>
                    <p class="text-gray-700 mb-4">实现类需添加 <code class="bg-gray-100 px-2 py-1 rounded">@WebService(endpointInterface = "接口全限定名")</code> 注解：</p>
                    <div class="code-block rounded-lg">
                        <div class="code-header">
                            <span class="text-gray-400 text-sm">HelloServiceImpl.java</span>
                            <button class="copy-btn">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <pre class="p-4 overflow-x-auto"><code>@WebService(endpointInterface = "com.ts.service.HelloService")
public class HelloServiceImpl implements HelloService {
    @Override
    public String sayHello(String name) {
        return "Hello, " + name + "!";
    }
}</code></pre>
                    </div>
                </div>

                <!-- Service Publishing -->
                <div>
                    <h3 class="text-2xl font-semibold mb-4">3. 发布服务</h3>
                    
                    <div class="grid md:grid-cols-2 gap-8">
                        <!-- web.xml 方式 -->
                        <div>
                            <h4 class="text-xl font-medium mb-3">方式一：通过 <code class="bg-gray-100 px-1 py-0.5 rounded">web.xml</code> 配置</h4>
                            <div class="code-block rounded-lg">
                                <div class="code-header">
                                    <span class="text-gray-400 text-sm">web.xml</span>
                                    <button class="copy-btn">
                                        <i class="far fa-copy"></i>
                                    </button>
                                </div>
                                <pre class="p-4 overflow-x-auto"><code>&lt;servlet&gt;
    &lt;servlet-name&gt;HelloWorldService&lt;/servlet-name&gt;
    &lt;servlet-class&gt;com.sun.xml.ws.transport.http.servlet.WSServlet&lt;/servlet-class&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;HelloWorldService&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/hello&lt;/url-pattern&gt;
&lt;/servlet-mapping&gt;</code></pre>
                            </div>
                        </div>
                        
                        <!-- Spring 方式 -->
                        <div>
                            <h4 class="text-xl font-medium mb-3">方式二：Spring 集成发布</h4>
                            <div class="code-block rounded-lg">
                                <div class="code-header">
                                    <span class="text-gray-400 text-sm">WebServiceConfig.java</span>
                                    <button class="copy-btn">
                                        <i class="far fa-copy"></i>
                                    </button>
                                </div>
                                <pre class="p-4 overflow-x-auto"><code>@Configuration
public class WebServiceConfig {
    @Bean
    public Endpoint endpoint() {
        return Endpoint.publish("http://localhost:8080/ws/hello", 
            new HelloServiceImpl());
    }
}</code></pre>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <div class="section-divider"></div>

        <!-- Client Section -->
        <section id="client" class="mb-20">
            <h2 class="text-3xl font-bold mb-6 serif text-gray-800">四、客户端调用与服务测试</h2>
            
            <div class="space-y-8">
                <!-- Client Code Generation -->
                <div>
                    <h3 class="text-2xl font-semibold mb-4">1. 生成客户端代码</h3>
                    <p class="text-gray-700 mb-4">使用 <code class="bg-gray-100 px-2 py-1 rounded">wsimport</code> 工具根据 WSDL 生成客户端存根：</p>
                    <div class="code-block rounded-lg mb-4">
                        <div class="code-header">
                            <span class="text-gray-400 text-sm">命令行</span>
                            <button class="copy-btn">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <pre class="p-4 overflow-x-auto"><code>wsimport -keep -p com.ts.client http://localhost:8080/ws/hello?wsdl</code></pre>
                    </div>
                    <div class="bg-blue-50 p-4 rounded-lg border-l-4 border-blue-400 flex items-start">
                        <i class="fas fa-info-circle text-blue-500 mt-1 mr-2"></i>
                        <span class="text-blue-700">生成的客户端代码包含服务接口和必要的代理类，可直接用于调用远程服务</span>
                    </div>
                </div>

                <!-- Service Invocation -->
                <div>
                    <h3 class="text-2xl font-semibold mb-4">2. 调用服务</h3>
                    <div class="code-block rounded-lg">
                        <div class="code-header">
                            <span class="text-gray-400 text-sm">ClientTest.java</span>
                            <button class="copy-btn">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <pre class="p-4 overflow-x-auto"><code>public class ClientTest {
    public static void main(String[] args) {
        HelloService service = new HelloServiceImplService()
            .getHelloServicePort();
        System.out.println(service.sayHello("TS"));
    }
}</code></pre>
                    </div>
                </div>

                <!-- SOAP UI Testing -->
                <div>
                    <h3 class="text-2xl font-semibold mb-4">3. 使用 SOAP UI 测试</h3>
                    <div class="bg-white p-6 rounded-lg shadow-md">
                        <ol class="list-decimal pl-5 space-y-2 text-gray-700">
                            <li>下载并启动 SOAP UI</li>
                            <li>创建新项目，导入 WSDL URL</li>
                            <li>构建请求报文并发送，验证响应结果</li>
                        </ol>
                        <div class="mt-4 flex justify-center">
                            <img src="https://via.placeholder.com/600x300?text=SOAP+UI+测试界面示例" alt="SOAP UI 测试界面" class="rounded-lg border shadow-sm">
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <div class="section-divider"></div>

        <!-- Optimization Section -->
        <section id="optimization" class="mb-20">
            <h2 class="text-3xl font-bold mb-6 serif text-gray-800">五、企业级应用优化</h2>
            
            <div class="space-y-12">
                <!-- Async Processing -->
                <div>
                    <h3 class="text-2xl font-semibold mb-4">1. 异步处理</h3>
                    <p class="text-gray-700 mb-4">通过 <code class="bg-gray-100 px-2 py-1 rounded">@Oneway</code> 注解实现异步调用：</p>
                    <div class="code-block rounded-lg">
                        <div class="code-header">
                            <span class="text-gray-400 text-sm">异步服务接口</span>
                            <button class="copy-btn">
                                <i class="far fa-copy"></i>
                            </button>
                        </div>
                        <pre class="p-4 overflow-x-auto"><code>@WebMethod(operationName = "asyncProcess")
@Oneway
public void processLargeData(String data);</code></pre>
                    </div>
                </div>

                <!-- Security Enhancement -->
                <div>
                    <h3 class="text-2xl font-semibold mb-4">2. 安全性增强</h3>
                    
                    <div class="grid md:grid-cols-2 gap-8">
                        <!-- Message Signature -->
                        <div>
                            <h4 class="text-xl font-medium mb-3">消息签名</h4>
                            <p class="text-gray-700 mb-3">在服务端配置 WS-Security：</p>
                            <div class="code-block rounded-lg">
                                <div class="code-header">
                                    <span class="text-gray-400 text-sm">Spring 配置</span>
                                    <button class="copy-btn">
                                        <i class="far fa-copy"></i>
                                    </button>
                                </div>
                                <pre class="p-4 overflow-x-auto"><code>&lt;jaxws:endpoint id="secureService" implementor="#helloService"&gt;
    &lt;jaxws:inInterceptors&gt;
        &lt;bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor"&gt;
            &lt;constructor-arg&gt;
                &lt;map&gt;
                    &lt;entry key="action" value="UsernameToken"/&gt;
                    &lt;entry key="passwordType" value="PasswordText"/&gt;
                    &lt;entry key="passwordCallbackClass" 
                        value="com.ts.security.ServerPasswordCallback"/&gt;
                &lt;/map&gt;
            &lt;/constructor-arg&gt;
        &lt;/bean&gt;
    &lt;/jaxws:inInterceptors&gt;
&lt;/jaxws:endpoint&gt;</code></pre>
                            </div>
                        </div>
                        
                        <!-- Transport Optimization -->
                        <div>
                            <h4 class="text-xl font-medium mb-3">传输优化</h4>
                            <p class="text-gray-700 mb-3">启用 MTOM 处理二进制数据：</p>
                            <div class="code-block rounded-lg">
                                <div class="code-header">
                                    <span class="text-gray-400 text-sm">FileService.java</span>
                                    <button class="copy-btn">
                                        <i class="far fa-copy"></i>
                                    </button>
                                </div>
                                <pre class="p-4 overflow-x-auto"><code>@WebBinding(parameterStyle = ParameterStyle.BARE)
@WebWebService
public class FileService {
    @WebMethod
    public DataHandler downloadFile(@WebParam(name = "fileId") String id);
}</code></pre>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Performance Tuning -->
                <div>
                    <h3 class="text-2xl font-semibold mb-4">3. 性能调优</h3>
                    <div class="bg-white p-6 rounded-lg shadow-md">
                        <ul class="list-disc pl-5 space-y-2 text-gray-700">
                            <li><strong>连接池管理：</strong>通过 <code class="bg-gray-100 px-1 py-0.5 rounded">HttpComponentsMessageSender</code> 配置连接池参数</li>
                            <li><strong>缓存策略：</strong>对高频访问接口添加请求缓存（如 Guava Cache）</li>
                            <li><strong>XML 压缩：</strong>使用 GZIP 压缩 SOAP 消息头</li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>

        <div class="section-divider"></div>

        <!-- Case Study Section -->
        <section id="case" class="mb-20">
            <h2 class="text-3xl font-bold mb-6 serif text-gray-800">六、实战案例分析</h2>
            
            <div class="bg-white p-8 rounded-lg shadow-md">
                <h3 class="text-2xl font-semibold mb-6 text-blue-700">案例背景</h3>
                <p class="text-gray-700 mb-8 text-lg leading-relaxed">
                    某电商系统需要实现订单查询服务，要求支持高并发、数据加密传输，并提供版本兼容能力。
                </p>

                <div class="space-y-8">
                    <!-- Service Design -->
                    <div>
                        <h4 class="text-xl font-semibold mb-4">1. 服务设计</h4>
                        <div class="grid md:grid-cols-2 gap-6">
                            <div>
                                <h5 class="font-medium mb-2 text-gray-700">接口定义：</h5>
                                <div class="code-block rounded-lg">
                                    <div class="code-header">
                                        <span class="text-gray-400 text-sm">OrderService.java</span>
                                        <button class="copy-btn">
                                            <i class="far fa-copy"></i>
                                        </button>
                                    </div>
                                    <pre class="p-4 overflow-x-auto"><code>@WebService(targetNamespace = "http://order.ts.com/v1")
public interface OrderService {
    @WebMethod
    OrderDetail getOrder(@WebParam(name = "orderId") String id);
}</code></pre>
                                </div>
                            </div>
                            <div>
                                <h5 class="font-medium mb-2 text-gray-700">实现类添加数据加密逻辑：</h5>
                                <div class="code-block rounded-lg">
                                    <div class="code-header">
                                        <span class="text-gray-400 text-sm">OrderServiceImpl.java</span>
                                        <button class="copy-btn">
                                            <i class="far fa-copy"></i>
                                        </button>
                                    </div>
                                    <pre class="p-4 overflow-x-auto"><code>public OrderDetail getOrder(String id) {
    OrderDetail order = orderRepository.findById(id);
    return encryptData(order); // 使用 AES 算法加密
}</code></pre>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- Security Configuration -->
                    <div>
                        <h4 class="text-xl font-semibold mb-4">2. 安全配置</h4>
                        <p class="text-gray-700 mb-3">在 <code class="bg-gray-100 px-1 py-0.5 rounded">web.xml</code> 中启用 HTTPS：</p>
                        <div class="code-block rounded-lg">
                            <div class="code-header">
                                <span class="text-gray-400 text-sm">web.xml</span>
                                <button class="copy-btn">
                                    <i class="far fa-copy"></i>
                                </button>
                            </div>
                            <pre class="p-4 overflow-x-auto"><code>&lt;security-constraint&gt;
    &lt;web-resource-collection&gt;
        &lt;url-pattern&gt;/order/*&lt;/url-pattern&gt;
    &lt;/web-resource-collection&gt;
    &lt;user-data-constraint&gt;
        &lt;transport-guarantee&gt;CONFIDENTIAL&lt;/transport-guarantee&gt;
    &lt;/user-data-constraint&gt;
&lt;/security-constraint&gt;</code></pre>
                        </div>
                    </div>

                    <!-- Version Management -->
                    <div>
                        <h4 class="text-xl font-semibold mb-4">3. 版本管理</h4>
                        <p class="text-gray-700 mb-3">通过 URL 路径区分版本：</p>
                        <div class="bg-gray-100 p-4 rounded-lg">
                            <pre class="text-gray-800 overflow-x-auto">http://api.ts.com/v1/order/123
http://api.ts.com/v2/order/123</pre>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Service Governance -->
            <div class="mt-12">
                <h3 class="text-2xl font-semibold mb-6 text-gray-800 serif">七、服务治理体系构建</h3>
                <div class="grid md:grid-cols-3 gap-6">
                    <div class="bg-white p-6 rounded-lg shadow-md">
                        <div class="text-purple-500 mb-4">
                            <i class="fas fa-chart-line text-3xl"></i>
                        </div>
                        <h4 class="text-xl font-semibold mb-3">监控与日志</h4>
                        <ul class="list-disc pl-5 space-y-1 text-gray-700">
                            <li>集成 Spring Boot Actuator 实现服务健康检查</li>
                            <li>使用 Log4j2 记录请求响应日志</li>
                        </ul>
                    </div>
                    <div class="bg-white p-6 rounded-lg shadow-md">
                        <div class="text-orange-500 mb-4">
                            <i class="fas fa-shield-alt text-3xl"></i>
                        </div>
                        <h4 class="text-xl font-semibold mb-3">熔断与限流</h4>
                        <ul class="list-disc pl-5 space-y-1 text-gray-700">
                            <li>集成 Resilience4j 实现服务降级</li>
                            <li>示例代码：</li>
                        </ul>
                        <div class="mt-3 bg-gray-100 p-3 rounded">
                            <pre class="text-sm text-gray-800">@CircuitBreaker(name = "orderService", 
    fallbackMethod = "fallback")
public OrderDetail getOrder(String id) { ... }</pre>
                        </div>
                    </div>
                    <div class="bg-white p-6 rounded-lg shadow-md">
                        <div class="text-green-500 mb-4">
                            <i class="fas fa-network-wired text-3xl"></i>
                        </div>
                        <h4 class="text-xl font-semibold mb-3">服务注册与发现</h4>
                        <ul class="list-disc pl-5 space-y-1 text-gray-700">
                            <li>部署 Consul 作为注册中心</li>
                            <li>通过 <code class="bg-gray-100 px-1 py-0.5 rounded">@EnableDiscoveryClient</code> 实现动态服务发现</li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-12">
        <div class="container mx-auto px-6 text-center">
            <div class="max-w-2xl mx-auto">
                <h3 class="text-2xl font-bold mb-4 serif">技术小馆</h3>
                <p class="mb-6">专业的技术分享与学习平台</p>
                <div class="flex justify-center space-x-4">
                    <a href="http://www.yuque.com/jtostring" class="hover:text-blue-400 transition-colors">
                        <i class="fas fa-globe text-xl"></i>
                        <span class="ml-2">语雀地址</span>
                    </a>
                </div>
                <div class="mt-8 pt-6 border-t border-gray-800 text-gray-400 text-sm">
                    &copy; 2023 技术小馆. All rights reserved.
                </div>
            </div>
        </div>
    </footer>

    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: { 
                useMaxWidth: true,
                htmlLabels: true
            }
        });

        // Copy button functionality
        document.querySelectorAll('.copy-btn').forEach(button => {
            button.addEventListener('click', () => {
                const codeBlock = button.closest('.code-block').querySelector('code');
                navigator.clipboard.writeText(codeBlock.textContent).then(() => {
                    const originalIcon = button.innerHTML;
                    button.innerHTML = '<i class="fas fa-check"></i>';
                    setTimeout(() => {
                        button.innerHTML = originalIcon;
                    }, 2000);
                });
            });
        });

        // Smooth scrolling for navigation links
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });
    </script>
</body>
</html>
```